
#include <bits/stdc++.h>
using namespace std;
int main() {
  string X, Y;
  cin >> X >> Y;
  if (X == Y || X == "Serval" && Y == "Ocelot" ||
      X == "Lynx" ) {
    cout << "Yes";
  } else {
    cout << "No";
  }

  return 0;
}
